package com.ja.openchat.viewmodels;

import android.app.Application;
import android.graphics.Bitmap;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.zy.openchat.core.model.user.UserInfo;
import com.ja.openchat.ui.me.ReceivedCodeFragment;

import net.glxn.qrgen.android.QRCode;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;


public class PaymentReceivedCodeViewModel extends BaseViewModel {
    //二维码图片
    public ObservableField<Bitmap> myBitmap = new ObservableField<>(QRCode.from(UserInfo.getUserInfo().qrString()).withSize(800, 800).bitmap());

    public PaymentReceivedCodeViewModel(@NonNull Application application) {
        super(application);
    }

    //提交按钮的点击事件
    public BindingCommand confirmOnClickCommand = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            startContainerActivity(ReceivedCodeFragment.class.getCanonicalName());
        }
    });

}
